<?php

// 抽奖奖品表

namespace app\console\model;

use think\Db;
use think\Model;
use app\console\model\LuckDraw as LuckDrawModel;

class DrawGoods extends Model
{
    protected static function init()
    {
        // 新增之前
        self::event('before_write',function ($data) {

           $data->create_time = date('Y-m-d',time());
           $data->picUrl = uploadImg();
           $data->thumb_img = show_thumb_pic($data->picUrl);

       });



    }


    // protected function getStatusAttrText($data,$value)
    // {
    //     $status = [0=>'已下架',1=>'已上架'];
    //
    //     return $status[$data['status']];
    // }
}